#include "AES.h"
#include "TestBase.h"
#include "CryptoSystem.h"
#include "Config.h"

TestBase::TestBase()
{
	info.Name = "CryptoSystem Test 4 - AES OFB";
	info.Category = 0x3102;
	info.CategoryName = "CryptoSystem";
	info.File = __FILE__;
}

bool TestBase::Run()
{
	std::string confFile = "TestModules/CryptoSystemTest4.conf", message = "The small brown fox ran through the forest.", str;
	if (!conf.ParseConfigFile(confFile))
	{
		printf("Error reading Config file\n");
		return false;
	}
	char buf[48];
	crypto.Init();
	NetworkMessage msg;
	msg.AddString(message);
	crypto.Encrypt(msg);
	crypto.Decrypt(msg);
	msg.SetPosition(0);
	str = msg.GetString();
	if (str != message)
	{
		std::cout << GetTestInfo()->Name << " failure info" << std::endl;
		printf("Expected output : %s\n", message.c_str());
		printf("Output          : %s\n", str.c_str());
		return false;
	} // */
	return true;
}